
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import router from './router'
import axios from 'axios'
import { createPinia } from 'pinia'
import pluginState from 'pinia-plugin-persistedstate'

const app = createApp(App)
const pinia = createPinia()


pinia.use(pluginState)
app.use(pinia)
app.use(ElementPlus)
app.use(router)
// 全局路由守卫
router.afterEach(() => {
  setTimeout(() => {
    window.scrollTo(0, 0)
  }, 100) // 延迟确保DOM更新
})
app.config.globalProperties.$axios = axios
app.mount('#app')
